﻿#region Using Directives

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;

    using Csla;

    using MarketPulse.BusinessLogic.Common.Criteria;
    using MarketPulse.BusinessLogic.Core;

#endregion

namespace MarketPulse.BusinessLogic.Private
{
    /// <summary>
    /// This class represents a collection of AssignmentPayments that are associated with an Assignment during it's lifetime.
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.AssignmentFactory, MarketPulse.DataAccess.Factory", "FetchAssignmentPaymentList")]
    public class AssignmentPaymentList : MarketPulseListBase<AssignmentPaymentList, AssignmentPayment>
    {

        #region Constructors

            /// <summary>
            /// Default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private AssignmentPaymentList()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                /// <summary>
                /// Method used to create a new collection of AssignmentPaymentList objects via the DataPortal client proxy
                /// </summary>
                /// <returns>The newly created collection of AssignmentPayments</returns>
                internal static AssignmentPaymentList New()
                {
                    return DataPortal.CreateChild<AssignmentPaymentList>();
                }

                /// <summary>
                /// Method used to get a list of AssignmentPayments that are associated with a specific Assignment
                /// </summary>
                /// <param name="assignmentGuid">The Guid of the Assignment to retrieve the AssignmentPayment list for</param>
                /// <returns>The populated Assignment Payment List collection</returns>
                internal static AssignmentPaymentList GetByAssignmentGuidAndVersionId(Guid assignmentGuid, long assignmentVersionId)
                {
                    return DataPortal.Fetch<AssignmentPaymentList>(new UniqueAssignmentCriteria(assignmentGuid, assignmentVersionId));
                }

            #endregion



        #endregion

    }
}
